﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GA.Server.Api;
using GA.Server.Configuration;
using GA.Server.Objects;
using GA.Server.ConnectionListener;
using GA.Shared.Objects;
using GA.Shared.Interfaces;

namespace GA.Server.Managers
{
    public class GameClassManagerServer : GAServer, IObjectServer
    {
        public GameClassManagerServer()
        {
        }

        public GameClassManagerServer(ServerPropertiesElementCollection properties)
            : base(properties)
        {
            if (properties == null) throw new ArgumentNullException("properties");

            mGameClasses = new Dictionary<int, DatabaseGameClass>();
            mGameClassLevels = new Dictionary<int, DatabaseGameClassLevel>();
            mGameClassTypes = new Dictionary<int, DatabaseGameClassType>();
        }

        public override void RegisterServer(GAServer newServer)
        {
            if (newServer is ConnectionListenerServer)
            {
                ((ConnectionListenerServer)newServer).RegisterObjectServer<GameClass>(this);
                ((ConnectionListenerServer)newServer).RegisterObjectServer<GameClassLevel>(this);
                ((ConnectionListenerServer)newServer).RegisterObjectServer<GameClassType>(this);
            }
        }

        private Dictionary<int, DatabaseGameClass> mGameClasses;
        private Dictionary<int, DatabaseGameClassLevel> mGameClassLevels;
        private Dictionary<int, DatabaseGameClassType> mGameClassTypes;


        #region IObjectServer Members

        public SerializableTransferObject CreateObject(SerializableTransferObject authorizedUser, SerializableTransferObject newObject)
        {
            #warning Not Implemented
            throw new NotImplementedException();
        }

        public void EditObject(SerializableTransferObject authorizedUser, SerializableTransferObject editObject)
        {
            #warning Not Implemented
        }

        public void DeleteObject(SerializableTransferObject authorizedUser, SerializableTransferObject deleteObject)
        {
            #warning Not Implemented
        }

        public SerializableTransferObject GetObject(SerializableTransferObject authorizedUser, string type, Dictionary<string, object> parameters)
        {
            #warning Not Implemented
            throw new NotImplementedException();
        }

        public IEnumerable<SerializableTransferObject> GetObjects(SerializableTransferObject authorizedUser, string type, Dictionary<string, object> parameters)
        {
            #warning Not Implemented
            throw new NotImplementedException();
        }

        #endregion
    }
}
